import CommonRequestDataAction from '../common/CommonRequestDataAction';
import Constants from '../../common/Constants';

export default class QZ_RequestQuanziHotListAction extends CommonRequestDataAction {
  constructor() {
    super();

    this.moduleType = Constants.MODULE_TYPE.QUAN_ZI;
    this.name = "QZ_RequestQuanziHotListAction";
  }

  finish(data, isSucceed, response) {
      if(isSucceed) {
        this.caller.setState({
          viewStatus:3,
          data: data.boards||[],
          isResponeUpdate: true,
        })
        if(data && data.length > 0){
          Constants.IS_WELLCOME = true;
        }

        this.onFinishSuccess(data, response);
      }
      else if (response) {
        if(response.status == 401) {
          this._dealUnauthorized(this.caller);
        }
        else {
          this.caller.setState({viewStatus: response.status})
        }
      }
      else {
        this.caller.setState({viewStatus: 400})
      }
    }
}
